function (add_my_test)
    set(perfix ARG)
    set(noValues)
    set(singleValues MY_TEST_NAME)
    set(multiValues SOURCE INCLUDE_DIR LIBRARIES)

    include(CMakeParseArguments)
    cmake_parse_arguments(
        ${perfix}
        "${noValues}"
        "${singleValues}"
        "${multiValues}"
        ${ARGN}
    )

    foreach(arg IN LISTS singleValues multiValues)
        if ("${arg}" STREQUAL "SOURCE")
            set(src ${${perfix}_${arg}})
        endif()

        if ("${arg}" STREQUAL "MY_TEST_NAME")
            set(testName ${${perfix}_${arg}})
        endif()

        if ("${arg}" STREQUAL "INCLUDE_DIR")
            set(include_dir ${${perfix}_${arg}})
        endif()

        if ("${arg}" STREQUAL "LIBRARIES")
            set(lib ${${perfix}_${arg}})
        endif()
    endforeach()

    add_executable(${testName} ${src})

    if (MSVC)
        set_target_properties(${testName} PROPERTIES COMPILE_FLAGS "/EHsc")
    endif()
    
    target_include_directories(${testName} PRIVATE ${include_dir})
    target_link_libraries(${testName} PRIVATE ${lib})
    add_test(NAME ${testName} COMMAND ${testName})
endfunction()

add_my_test(MY_TEST_NAME "testSdlSwap"
            LIBRARIES T3SRLib SDL2::SDL2 SDL2::SDL2main
            SOURCE test_sdl_swap.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include ${SDL2_INCLUDE_DIR})

add_my_test(MY_TEST_NAME "testT3SR"
            LIBRARIES T3SRLib SDL2::SDL2 SDL2::SDL2main imgui
            SOURCE test_t3srapp.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include ${SDL2_INCLUDE_DIR} ${IMGUI_INCLUDE_DIR})

add_my_test(MY_TEST_NAME "testMatrix"
            LIBRARIES T3SRLib imgui
            SOURCE test_mat4.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include ${IMGUI_INCLUDE_DIR})

add_my_test(MY_TEST_NAME "testUtiliyMath"
            LIBRARIES T3SRLib
            SOURCE test_utility_math.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)

add_my_test(MY_TEST_NAME "testTexture"
            LIBRARIES T3SRLib SDL2::SDL2 SDL2::SDL2main
            SOURCE test_texture.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include ${SDL2_INCLUDE_DIR})

add_my_test(MY_TEST_NAME "testImgui"
            LIBRARIES SDL2::SDL2 SDL2::SDL2main imgui
            SOURCE test_imgui.cpp
            INCLUDE_DIR ${SDL2_INCLUDE_DIR} ${IMGUI_INCLUDE_DIR})

add_my_test(MY_TEST_NAME "testTransform"
            LIBRARIES T3SRLib
            SOURCE test_transform.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)

add_my_test(MY_TEST_NAME "testScene"
            LIBRARIES T3SRLib
            SOURCE test_scene.cpp
            INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)